package com.smartao.core.info;

import com.smartao.core.BaseContext;
import com.smartao.extend.Date;

public class ServerInfo {

	//private Date currentTime;
	//private Date startTime;
	//private String runningTime;
	private String maxMomery = "350M";
	private String usedMomery = "300M";
	private String freeMomery = "50M";

	public Date getCurrentTime() {
		return new Date();
	}

	public Date getStartTime() {
		return BaseContext.getStartTime();
	}

	public String getRunningTime() {
		int day = (int) (getCurrentTime().getTime() - getStartTime().getTime()) / (3600 * 24 * 1000);
		int hour = (int) (getCurrentTime().getTime() - getStartTime().getTime()) / (3600 * 1000) % 24;
		int minute = (int) (getCurrentTime().getTime() - getStartTime().getTime()) / (60 * 1000) % 60;
		int second = (int) (getCurrentTime().getTime() - getStartTime().getTime()) / 1000 % 60;
		return day + "天" + hour + "小时" + minute + "分钟" + second + "秒";
	}

	public String getMaxMomery() {
		return maxMomery;
	}

	public String getUsedMomery() {
		return usedMomery;
	}

	public String getFreeMomery() {
		return freeMomery;
	}

}
